import 'dart:io';

/// 描述: App全局信息，多是常量
/// 
/// @Author tangzhentao
///  @CreatedTime 19:46 2022/6/17
/// 

class App {
  /// 应用名称
  static const appName = '先锋金';

  /// 用户登录的平整
  static const authorization = 'authorization';
  /// 用户信息
  static const userInfo = 'userInfo';
  /// 是否同意用户协议和隐私政策
  static const agree = 'agree';
  /// 黄金回收保证金比例（%）
  static const collateralRate = 'collateralRate';

  /// 客服电话
  static const customPhone = "19941775128";

  /// 微信 appId
  static const wxAppId = 'wxf299a0a6fca41c91';
  /// 微信 universalLink
  static const wxUniversalLink = 'https://cc.aieng.words/app/';

  /// 穿山甲广告appid
  static const unionAdAppId = '5429690';
  /// 穿山甲 安卓 开屏广告代码位
  static const unionAdAndroidSplashCode = '889702459';
  /// 穿山甲 安卓 banner广告代码位
  static const unionAdAndroidBannerCode = '959619965';
  /// 穿山甲 苹果 开屏广告代码位
  static const unionAdIosSplashCode = '888644706';
  /// 穿山甲 苹果 banner广告代码位
  static const unionAdIosBannerCode = '954401971';

  /// 公共参数
  static const commonParamsAndroidAppId = '1597098936915668992';
  static const commonParamsIosAppId = '1597098932511649792';

  /// 获取AppId
  static String getCommonParamsAppId() => Platform.isAndroid ? commonParamsAndroidAppId:commonParamsIosAppId;

  /// 获取平台
  static String getPlatform() => Platform.isAndroid ? 'ANDROID':'IOS';

  /// 获取操作系统
  static String getSystemOS() => Platform.isAndroid ? 'Android OS':'IOS';

  /// 获取操作系统版本
  static String getSystemVersion(dynamic code) => Platform.isAndroid ? 'Android $code':'Ios $code';
}

/// 公共参数说明
/// 应用ID，APP版本号，平台，设备型号，操作系统， 操作系统版本， 用户灵排
class CommonHeader {
  final String appId;
  final String? version;
  final String? platform;
  final String? deviceNo;
  final String? systemOS;
  final String? systemVersion;

  CommonHeader(this.appId, {this.version, this.platform, this.deviceNo, this.systemOS, this.systemVersion});
}

/// 不同环境值
class Environment {
  static const prod = "PROD";
  static const dev = "DEV";
  static const local = "LOCAL";
}